package com.vpen.exception;

import com.vpen.base.BaseCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @version: 1.0
 * @author: Vpen
 * @date: 2021/10/2 21:44
 * @content:
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class IException extends RuntimeException {
    private static final long serialVersionUID = 1044896456497285L;
    private String code;


    public IException() {
        this(BaseCode.ERROR);
    }

    public IException(BaseCode codeEnum) {
        super(codeEnum.getMsg());
        this.code = codeEnum.getCode();
    }

    public IException(String code, String message) {
        super(message);
        this.code = code;
    }

}
